package com.sd.app;


import android.app.AlertDialog;
import android.app.Application;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;

import com.sd.activity.R;
import com.sd.util.PreferencesManager;

/**
 * 
 * 
 * 
 * @author Alex.Lu
 *
 */
public class BetaReadApp extends Application{

	
    
	@Override
	public void onCreate() {
		super.onCreate();
		PreferencesManager.getInstance().initPreferences(getApplicationContext());
		AppInit.getInstance().init(getApplicationContext());
	}
	
	/**
	 * 是否退出客户端的对话框
	 */
	public void createExitDialog() {
		Builder builder = new AlertDialog.Builder(this);
		
		builder.setMessage(getString(R.string.msg_exit)).setPositiveButton(
				R.string.btn_ok, new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int whichButton) {
						System.exit(0);
					}
				}).setNegativeButton(R.string.btn_cancel,
				new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int whichButton) {
						dialog.dismiss();
					}
				}).show();
	}
}
